﻿<cfcomponent>
<cfscript>
DB = 'chinalaohu';
dbt = 'user_recharge';
</cfscript>

<!---会员余额--->
<cffunction name="userrecharge" access="remote" returntype="query">
	<cfquery datasource="#DB#" name="userrecharge">
	<!---  原表已经取消，改用新表
  select *
  from #dbt#
  WHERE 
  uid = #uid#
  order by rid desc
  --->
select a.id as rid,a.uid,if((a.process_type=1),'提现','充值') as financeType,a.amount,b.amount as recharge,a.process_type,a.add_time as dt,'' as ip from user_account a left outer join user_account_pertotal b on a.id=b.xid where a.uid='#uid#' and (a.process_type=1 or a.is_paid=1) order by a.id desc
  </cfquery>
  <cfreturn userrecharge>
</cffunction>

<!---获取最新余额--->
<cffunction name="getuserrecharge" access="public" returntype="numeric">
	<cfinvoke component="app.cfc.deposit" method="getbzjvalue" returnvariable="res" uid="#uid#" />
	<cfreturn res>
</cffunction>

</cfcomponent>